import QtQuick 2.8
import QtQuick.Controls 2.1
import QtWeChat 1.0

Button {
    id: root
    implicitWidth: 35
    implicitHeight: 25
    hoverEnabled: true

    property bool isCloseButton: false
    property alias source: icon.source

    background: Rectangle {
        anchors.fill: parent
        visible: root.hovered
        color: root.isCloseButton ? "#FF3B30" : "#E3E3E3"
    }

    Image {
        anchors.centerIn: parent
        id: icon
        Selector on source {
            states: [
                { "hover" : root.hovered },
            ]
        }
    }
}
